package net.fpeg.kotlin.msa.wordbase.dao

import net.fpeg.kotlin.msa.wordbase.entity.Word
import net.fpeg.kotlin.msa.wordbase.entity.WordBase
import net.fpeg.kotlin.msa.wordbase.entity.WordTag
import net.fpeg.kotlin.msa.wordbase.entity.WordUser
import org.springframework.data.jpa.repository.JpaRepository

interface WordBaseDao : JpaRepository<WordBase, Long> {
    fun getByWordUser_IdAndWordAndWordTag(wordUser_id: Long, word: Word, wordTag: WordTag): WordBase?
    fun getByWordUser_IdAndWord_ValueAndWordTag_Value(wordUser_id: Long, word_value: String, wordTag_value: String): WordBase?
    fun findByWordUser_IdAndWord_Value(wordUser_id: Long, wordValue: String): List<WordBase>
    fun findByWordUser_IdAndWordTag_Value(wordUser_id: Long, tagValue: String): List<WordBase>
    fun deleteByWordUser_IdAndWord_Value(wordUser_id: Long, word_value: String)
    fun deleteByWordUser_IdAndWord_ValueAndWordTag_Value(wordUser_id: Long, word_value: String, wordTag_value: String)
}